package formbean;

import java.util.ArrayList;
import java.util.List;

import org.mybeans.form.FormBean;

public class VideoCreateConfForm extends FormBean {
	
	private String creatorID;
	private String confName;
	private String noteTakerID;
	private String button;


	
	public String getConfName() {
		return confName;
	}
	public void setConfName(String confName) {
		this.confName = confName.trim();
	}
	public String getCreatorID() {
		return creatorID;
	}
	public void setCreatorID(String creatorID) {
		this.creatorID = creatorID.trim();
	}
	public String getNoteTakerID() {
		return noteTakerID;
	}
	public void setNoteTakerID(String noteTakerID) {
		this.noteTakerID = noteTakerID.trim();
	}
	public String getButton() {
		return button;
	}
	public void setButton(String button) {
		this.button = button.trim();
	}
	
	
	
	public List<String> getValidationErrors() {
		List<String> errors = new ArrayList<String>();

		if (creatorID == null || creatorID.length() == 0) {
			errors.add("creatorID is required");
		}
		
		if (confName == null || confName.length() == 0) {
			errors.add("Conference Name is required");
		}
		
		if (noteTakerID == null || noteTakerID.length() == 0) {
			errors.add("Note Taker is required");
		}
		
		if (creatorID.matches(".*[<>\"].*")) {
			errors.add("creatorID may not contain angle brackets or quotes");
		}
		
		if (confName.matches(".*[<>\"].*")) {
			errors.add("Conference Name may not contain angle brackets or quotes");
		}
		
		
		if (noteTakerID.matches(".*[<>\"].*")) {
			errors.add("Note Taker may not contain angle brackets or quotes");
		}
		
		
		return errors;
	}
}